<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,shrink-to-fit=no">
    <title>随手记忘记密码</title>
    <link rel="shortcut icon"
          href="https://static.app.yinxiang.com/embedded-web/registration/favicon.ico"/>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/reg.css">

</head>
<body>
<div class="regdiv">
    <div class="reglogo"></div>
    <h3 class="center">忘记密码？</h3>
    <div class="reginput">
        <h3 class="center">重置密码</h3>
        <div class="input" id="phoneinput"><input id="tel" placeholder="请输入你的手机号"/></div>
        <div class="error error1" id="error1"></div>

        <div>
            <div class="regbtn btn" id="resetbtn1">重置密码</div>
        </div>
        <div style="text-align: center;font-size:14px" id="tip"></div>

    </div>
</div>


<script src="https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/js/lib/jquery-1-cc52697ab1.10.2.js"></script>
<script src="js/base.js"></script>
<script>
   // var phoneRight = false;
    //当光标离开tel文本框
    // tel.onblur = function () {
    //     console.log(2);
    //     //ajax是需要时间的
    //     ajax("/bijiuser/checktel",
    //         {
    //             tel: tel.value
    //         },
    //         function (data) {
    //             error1.innerHTML = data ? "该号码未注册" : "";
    //             console.log(3);
    //             phoneRight = !data;
    //         });
    // };

    resetbtn1.onclick = function () {
        ajax("/bijiuser/checktel",
            {
                tel: tel.value
            },
            function (data) {
                error1.innerHTML = data ? "该号码未注册" : "";


                if(!data){//号码注册过，因为注册过data为false,所以!data才能为true，才能跳转
                    localStorage.forgetTel = tel.value;//把正确的号码记入本地存储，以后在其他页面都可以调出来
                    location = "forget2.html";
                }
            }
        );

    };


</script>
</body>
</html>
